import request from '@/utils/request'

/**
 * 获取企业信息列表
 * @param {*} params
 * @returns
 */
export function getEnterpriseListAPI(params) {
  return request({
    url: 'park/enterprise',
    method: 'GET',
    params
  })
}

/**
 * 查询企业所属行业列表
 * @returns
 */
export function getIndustryListAPI() {
  return request({
    url: '/park/industry'
  })
}

export function uploadFile(data) {
  return request({
    url: '/upload',
    method: 'POST',
    data
  })
}

export function insertEnterpriseAPI(data) {
  return request({
    url: 'park/enterprise',
    method: 'POST',
    data
  })
}

export function getIndustryDetailAPI(id) {
  return request({
    url: `park/enterprise/${id}`
  })
}

export function deleteEnterprise(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'DELETE'
  })
}

/**
 * 获取楼宇列表
 * @param {*} id
 * @returns
 */
export function getRentBuildListAPI() {
  return request({
    url: '/park/rent/building'
  })
}

/**
 * 创建合同
 * @param {*}
 * @returns
 */
export function createRentAPI(data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'POST',
    data
  })
}

/**
 * 企业租赁信息列表-展开查看
 * @param {*} id
 */
export function getRentExpandAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`
  })
}

/**
 * 退租租赁合同
 * @param {*} id
 */
export function updateRentAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'PUT'
  })
}
